<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			function isAnagram(arr1, arr2) {
				if (arr1.length != arr2.length) {
					return false;
				}
				for (var i = 0; i < arr2.length; i++) {
					if (arr1.indexOf(arr2[i]) == -1) {
						return false;
					} else {
						arr1.splice(arr1.indexOf(arr2[i]), 1);
					}
				}
				return arr1.length == 0;
			}
			console.log(isAnagram("listen","silent"));
		</script>
	</head>
	<body>
	</body>
</html>
